package com.fymxy.question_bank_management.mapper;

import com.fymxy.question_bank_management.pojo.Student2courseKey;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface Student2courseMapper {

    @Delete("delete from student2course where course_no = #{courseNo}")
    int deleteByCourseKey(Integer courseNo);

    @Insert("insert into student2course(course_no,student_no) values (#{courseNo},#{studentNo})")
    int insert(Student2courseKey record);

    int insertSelective(Student2courseKey record);

    @Delete("delete from student2course where course_no = #{courseNo} and student_no = #{studentNo}")
    int deleteStudentFromCourse(int courseNo, int studentNo);

}